﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Sisocana.Core.Models.ImagenModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Image Contents 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Image Contents </h2>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<p>
    <%: Html.ActionLink("Create New", "Create") %>
</p>
<%if (Model != null && Model.Count() != 0)
  { %>
    <table>
        <tr>
            <th></th>
            <th>
                Name
            </th>
            <th>
                Descriptions
            </th>
            <th>
                Web
            </th>
            <th>
                Logo
            </th>
        </tr>

    <% foreach (var item in Model) { %>
        <tr>
            <td>
               <%-- <%: Html.ActionLink("Edit", "Edit", new { id = item.nombre.Trim() })%> |           
                <%: Html.ActionLink("Delete", "Delete", new { id = item.nombre.Trim() })%>--%>

                <%= Html.MakeImgLink(Url.Action("Edit", "Imagen", new { id = item.nombre.Trim() }), "Edit", "edit.png")%> |
               <%= Html.MakeImgLink(Url.Action("Delete", "Imagen", new { id = item.nombre.Trim() }), "Delete", "delete.png")%>

            </td>
            <td>
                <%: item.nombre%>
            </td>
            <td>
                <%: item.descripcion%>
            </td>
            <td>
                <%: item.pagWeb%>
            </td>
            <td>
            <% if (item.logoNomb != null)
               { %>
                <img alt="logo" height="25px" width"25px" src='<%= Url.Action( "imagen", "Imagen", new { id = item.nombre.Trim() } ) %>' />
            <%} %>
        
            </td>
        </tr>
    <% } %>

    </table>
  <%}
  else { %>
        <p> There are not available images </p>
    <% } %>


</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
